import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'
//文章分类列表查询
export const animeCategoryListService = () =>{
   // const tokenStore = useTokenStore();
    //在pinia里定义的响应式数据,都不用value
    //return request.get('/anime/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('anime/category')
}

//分类添加
export const animeCategoryAddService = (categoryData) =>{
    return request.post('/anime/add',categoryData)
} 

//分类修改
export const animeCategoryUpdateService = (categoryData) =>{
    return request.put('/anime/category',categoryData)
}

//分类删除
export const animeCategoryDeleteService = (id) =>{
    return request.delete('/anime/category?id='+id)
}

//获取所有番的函数
export async function animeGetAllService(){
    return await request.get('/anime/getAll')
}

//搜索番剧的函数
export  async function animeSearchService(conditions){
    return await request.get('anime/search',{params:conditions}) 
}
